//
//  ServiceEvaluationScopeCell.m
//  BusinessMarket
//
//  Created by Michael Li on 2018/12/10.
//  Copyright © 2018年 Michael Li. All rights reserved.
//

#import "ServiceEvaluationScopeCell.h"
@interface ServiceEvaluationScopeCell()
@property (weak, nonatomic) IBOutlet UIButton *startOneBtn;
@property (weak, nonatomic) IBOutlet UIButton *startTwoBtn;
@property (weak, nonatomic) IBOutlet UIButton *startThreeBtn;
@property (weak, nonatomic) IBOutlet UIButton *startFourBtn;
@property (weak, nonatomic) IBOutlet UIButton *startFiveBtn;
@property (weak, nonatomic) IBOutlet UILabel *startL;
@end
@implementation ServiceEvaluationScopeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.startL.textColor = kLabel153Color;
}

- (IBAction)startOneBtn:(UIButton *)sender {
    sender.selected = !sender.selected;
    if (!sender.selected) {
        self.startTwoBtn.selected = NO;
        self.startThreeBtn.selected = NO;
        self.startFourBtn.selected = NO;
        self.startFiveBtn.selected = NO;
        self.startL.text = @"请点击选择";
        self.startL.textColor = kLabel153Color;
        if ([self.delegate respondsToSelector:@selector(serviceEvaluationScopeCell:withScope:)]) {
            [self.delegate serviceEvaluationScopeCell:self withScope:0];
        }
    }else {
        self.startL.text = @"2分 (差评)";
        self.startL.textColor = kOrangeBg;
        if ([self.delegate respondsToSelector:@selector(serviceEvaluationScopeCell:withScope:)]) {
            [self.delegate serviceEvaluationScopeCell:self withScope:2];
        }
    }
}
- (IBAction)startTwoBtn:(UIButton *)sender {
    sender.selected = !sender.selected;
    if (!sender.selected) {
//        self.startTwoBtn.selected = NO;
        self.startThreeBtn.selected = NO;
        self.startFourBtn.selected = NO;
        self.startFiveBtn.selected = NO;
        self.startL.text = @"2分 (差评)";
        self.startL.textColor = kOrangeBg;
        if ([self.delegate respondsToSelector:@selector(serviceEvaluationScopeCell:withScope:)]) {
            [self.delegate serviceEvaluationScopeCell:self withScope:2];
        }
    }else {
        self.startOneBtn.selected = YES;
        self.startL.text = @"4分 (差评)";
        self.startL.textColor = kOrangeBg;
        if ([self.delegate respondsToSelector:@selector(serviceEvaluationScopeCell:withScope:)]) {
            [self.delegate serviceEvaluationScopeCell:self withScope:4];
        }
    }
}
- (IBAction)startThreeBtn:(UIButton *)sender {
    sender.selected = !sender.selected;
    if (!sender.selected) {
//        self.startTwoBtn.selected = NO;
//        self.startThreeBtn.selected = NO;
        self.startFourBtn.selected = NO;
        self.startFiveBtn.selected = NO;
        self.startL.text = @"4分 (差评)";
        self.startL.textColor = kOrangeBg;
        if ([self.delegate respondsToSelector:@selector(serviceEvaluationScopeCell:withScope:)]) {
            [self.delegate serviceEvaluationScopeCell:self withScope:4];
        }
    }else {
        self.startOneBtn.selected = YES;
        self.startTwoBtn.selected = YES;
        self.startOneBtn.selected = YES;
        self.startL.text = @"6分 (中评)";
        self.startL.textColor = kOrangeBg;
        if ([self.delegate respondsToSelector:@selector(serviceEvaluationScopeCell:withScope:)]) {
            [self.delegate serviceEvaluationScopeCell:self withScope:6];
        }
    }
}
- (IBAction)startFourBtn:(UIButton *)sender {
    sender.selected = !sender.selected;
    if (!sender.selected) {
//        self.startTwoBtn.selected = NO;
//        self.startThreeBtn.selected = NO;
//        self.startFourBtn.selected = NO;
        self.startFiveBtn.selected = NO;
        self.startL.text = @"6分 (中评)";
        self.startL.textColor = kOrangeBg;
        if ([self.delegate respondsToSelector:@selector(serviceEvaluationScopeCell:withScope:)]) {
            [self.delegate serviceEvaluationScopeCell:self withScope:6];
        }
    }else {
        self.startOneBtn.selected = YES;
        self.startTwoBtn.selected = YES;
        self.startThreeBtn.selected = YES;
        self.startL.text = @"8分 (好评)";
        self.startL.textColor = kOrangeBg;
        if ([self.delegate respondsToSelector:@selector(serviceEvaluationScopeCell:withScope:)]) {
            [self.delegate serviceEvaluationScopeCell:self withScope:8];
        }
    }
}
- (IBAction)startFiveBtn:(UIButton *)sender {
    sender.selected = !sender.selected;
    if (!sender.selected) {
//        self.startTwoBtn.selected = NO;
//        self.startThreeBtn.selected = NO;
//        self.startFourBtn.selected = NO;
//        self.startFiveBtn.selected = NO;
        self.startL.text = @"8分 (好评)";
        self.startL.textColor = kOrangeBg;
        if ([self.delegate respondsToSelector:@selector(serviceEvaluationScopeCell:withScope:)]) {
            [self.delegate serviceEvaluationScopeCell:self withScope:8];
        }
    }else {
        self.startOneBtn.selected = YES;
        self.startTwoBtn.selected = YES;
        self.startThreeBtn.selected = YES;
        self.startFourBtn.selected = YES;
        self.startL.text = @"10分 (好评)";
        self.startL.textColor = kOrangeBg;
        if ([self.delegate respondsToSelector:@selector(serviceEvaluationScopeCell:withScope:)]) {
            [self.delegate serviceEvaluationScopeCell:self withScope:10];
        }
    }
}


@end
